home *** CD-ROM | disk | FTP | other *** search
- VRMENU.MOD (VR #2) --Makes choices pop up after letter.
- Vortex Rouge #163 @5853
- Thu, Dec 19, 1991 5:26 pm
- VRMENU.MOD
-
- _____________________________________________________________________________
- Name : VRMENU.MOD (Mod #2) Description: In any menu you choose, this
- Version : 4.20 Mod will output the routine after the letter
- Diffuculty: Easy IE: When a user hit's `D' it will print
- out `efaults' making it Defaults.
- _____________________________________________________________________________
- /* I started out thinking this would be an easy mod...but ran into some
- problems with nl()'s...I traced the new lines back to function *mmkey(..)
- I forgot exacly where I took stuff out of *mmkey(..)...but it wasn't much
- Just replace your orgional *mmkey with the *mmkey below.
-
- /* FILE: bbsutil.c */
- /* Begin VRMENU.MOD Blockread */
- char *mmkey(int dl)
- {
- static unsigned char cmd1[10],cmd2[81],ch;
- int i,i1,i2,p;
-
- do {
- do {
- ch=getkey();
- } while ((((ch<' ') && (ch!=13)) || (ch>126)) && (hangup==0));
- ch=upcase(ch);
- outchr(ch);
- if (ch==13)
- cmd1[0]=0;
- else
- cmd1[0]=ch;
- cmd1[1]=0;
- p=0;
- switch(dl) {
-
- case 1:
- if (strchr(dcd,ch)!=NULL)
- p=1;
- break;
- case 2:
- if (strchr(odc,ch)!=NULL)
- p=1;
- break;
- case 0:
- if (strchr(dc,ch)!=NULL)
- p=1;
- break;
- }
- if (p) {
- do {
- ch=getkey();
- } while ((((ch<' ') && (ch!=13) && (ch!=8)) || (ch>126)) && (hangup==0)); /* This line and the above are one line. From }while to ==0)); */
- ch=upcase(ch);
- if (ch==13) {
- nl();
- return(cmd1);
- } else
- if (ch==8) {
- backspace();
- } else {
- cmd1[1]=ch;
- cmd1[2]=0;
- outchr(ch);
- if (ch=='/') {
- input(cmd2,50);
- return(cmd2);
- } else
- return(cmd1);
- }
- } else {
- return(cmd1);
- }
- } while (hangup==0);
- cmd1[0]=0;
- return(cmd1);
- }
- /* End VRMENU.MOD Blockread */
-
- OK, here comes the time consuming part.. in all your main menu cases, do
- something like what was done below for defaults. If you have your prompt set
- on a different color than light blue, just chage the 1 in the prt statement
- to whatever number you wish. Just follow the below example, and you should
- be home free.
-
-
- case 'D':
- prt(1,"efaults");
- helpl=4;
- defaults();
- break;
-
-
- If you have any questions/comments send them to me at:
- 1 @5899 (SUBBnet)
- 163 @5853 (WWIVnet)
- 91 @5801 (VBBSnet)
- -=Insert Favorite Disclaimer Here=-
- -Vorte